package com.stefanini.pe.bbva.bp.in.report;

import java.awt.Color;
import java.awt.Font;

import net.sf.jasperreports.engine.JRChart;
import net.sf.jasperreports.engine.JRChartCustomizer;

import org.jfree.chart.JFreeChart;
import org.jfree.chart.labels.StandardPieSectionLabelGenerator;
import org.jfree.chart.plot.PiePlot;
import org.jfree.chart.plot.PiePlot3D;

/**
 * @author Teodor Danciu (teodord@users.sourceforge.net)
 * @version $Id:BarChartCustomizer.java 2317 2008-08-27 09:06:42Z teodord $
 */
public class PieChart3DCustomizer implements JRChartCustomizer {
	private Number tickUnits = 0;

	public void customize(JFreeChart chart, JRChart jasperChart) {
		
		PiePlot3D pieplot = (PiePlot3D) chart.getPlot();
		pieplot.setLabelFont(new Font(" Arial  ", Font.PLAIN, 7));
		pieplot.setLabelBackgroundPaint(Color.decode("#FFFFFF"));
		pieplot.setNoDataMessage("Datos No Disponibles");// There is no data to
		pieplot.setCircular(true);// Pie is a circle
		pieplot.setLabelGap(0.01D);
		pieplot.setLabelGenerator(null); 
		pieplot.setLegendLabelToolTipGenerator(new StandardPieSectionLabelGenerator(
						"Tooltip for legend item {0}"));
		if(chart.getLegend()!=null)
			chart.getLegend().setItemFont(new Font(" Arial  ", Font.PLAIN, 7));
		
		
	}
}
